<!DOCTYPE html>
<html  lang="zh-CN" >
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="theme-color" content="#fff" id="theme-color">
  <meta name="description" content="淡漠DM的博客">
  <link rel="icon" href="/img/logo.png">
  <title>手把手教你搭建、上线个人博客</title>
  
  
  <meta property="og:title" content="手把手教你搭建、上线个人博客">
  
  
  <meta property="og:url" content="http://blog.tomyres.com/2021/01/29/blog-1/index.html">
  
  
  <meta property="og:img" content="/img/author.jpg">
  
  
  <meta property="og:img" content="手把手教你用Hexo配合Gitee，搭建、上线个人博客">
  
  
  <meta property="og:type" content="article">
  <meta property="og:article:published_time" content="2021-01-29">
  <meta property="og:article:modified_time" content="2021-01-28">
  <meta property="og:article:author" content="淡漠DM">
  
  
  <meta property="og:article:tag" content="搭建个人博客">
  
  <meta property="og:article:tag" content="Hexo搭建博客">
  
  
  
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
    var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
      }
    };
    setDarkmode();
  </script>
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
  </script>
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  
  <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
  <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
  <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
  <link rel="prefetch" href="//unpkg.com/valine/dist/Valine.min.js" as="script">
  
  
  
  
<link rel="stylesheet" href="/css/main.css">

  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">

  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">

  
  
<link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">

  
  
  
  
  
  
  <link href="/js/lib/prism/prism-tomorrow.min.css" rel="stylesheet" data-prism="prism-tomorrow">
  
  
  
<link rel="stylesheet" href="/js/lib/prism/prism-line-numbers.min.css">

  
  
  
<meta name="generator" content="Hexo 5.3.0"></head>


<body>
  <div class="wrapper">
    
    <nav class="navbar">
  <div class="navbar-logo">
    <span class="navbar-logo-main">
      
      <img class="navbar-logo-img" src="/img/logo.png" alt="logo">
      
      <span class="navbar-logo-dsc">淡漠-Blog</span>
    </span>
  </div>
  <div class="navbar-menu">
    
    <a href="/" class="navbar-menu-item">
    
    首页
    
    </a>
    
    <a href="/archives" class="navbar-menu-item">
    
    归档
    
    </a>
    
    <a href="/tags" class="navbar-menu-item">
    
    标签
    
    </a>
    
    <a href="/categories" class="navbar-menu-item">
    
    分类
    
    </a>
    
    <a href="/about" class="navbar-menu-item">
    
    关于
    
    </a>
    
    <a href="/links" class="navbar-menu-item">
    
    友链
    
    </a>
    
    <a class="navbar-menu-item darknavbar" id="dark"><i class="iconfont icon-weather"></i></a>
    <a class="navbar-menu-item searchnavbar" id="search"><i class="iconfont icon-search" style="font-size: 1.2rem; font-weight: 400;"></i></a>
  </div>
</nav>
    
    <div id="local-search" style="display: none;">
      <input class="navbar-menu-item" id="search-input" placeholder="请输入搜索内容...">
      <div id="search-content"></div>
    </div>
    
    <div class="section-wrap">
      <div class="container">
        <div class="columns">
          <main class="main-column">
<article class="card card-content">
  <header>
    <h1 class="post-title">
      手把手教你搭建、上线个人博客
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2021-01-29T13:15:00.000Z">
      <i class="iconfont icon-calendar" style="margin-right: 2px;"></i>
      <span>2021-01-29</span>
    </time>
    
    <span class="dot"></span>
    
    <a href="/categories/个人博客/" class="post-meta-link">个人博客</a>
    
    
    
    <span class="dot"></span>
    <span>1.2k 字</span>
    
  </div>
  
  <div class="post-meta post-show-meta" style="margin-top: -10px;">
    <div style="display: flex; align-items: center;">
      <i class="iconfont icon-biaoqian" style="margin-right: 2px; font-size: 1.15rem;"></i>
      
      
        <a href="/tags/搭建个人博客/" class="post-meta-link">搭建个人博客</a>
      
      
      <span class="dot"></span>
      
        <a href="/tags/Hexo搭建博客/" class="post-meta-link">Hexo搭建博客</a>
      
    </div>
  </div>
  
  </header>
  <div id="section" class="post-content">
    <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>Hello，我是淡漠，今天带大家一起搭建个人博客。个人博客一直都是非常受欢迎的个人项目，个人博客分静态和动态两种，淡漠个人比较青睐静态博客，静态不需要管理后端，相比动态博客，静态博客可以不需要花一分钱，开发成本要低一些，毕竟作为学生党，买服务器放一个博客网站有点浪费，也可以把精力集中于写博客，而不是开发博客。</p>
<p>市面上有很多搭建静态博客的工具，这里以Hexo为例，带大家“速成”一下。</p>
<h2 id="一、创建博客项目"><a href="#一、创建博客项目" class="headerlink" title="一、创建博客项目"></a>一、创建博客项目</h2><p>安装Hexo</p>
<pre class="line-numbers language-none"><code class="language-none">npm install -g hexo-cli<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>初始化博客项目</p>
<pre class="line-numbers language-none"><code class="language-none">hexo init dm-blog<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>进入项目文件夹，安装相关依赖</p>
<pre class="line-numbers language-none"><code class="language-none">npm install<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>目录结构</p>
<pre class="line-numbers language-none"><code class="language-none">.
├── _config.yml
├── package.json
├── scaffolds
├── source
|   ├── _drafts
|   └── _posts
└── themes<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>打开_config.yml，配置基本信息</p>
<pre class="line-numbers language-none"><code class="language-none"># Site
title: 淡漠Blog
subtitle: &#39;&#39;
description: &#39;淡漠DM的博客&#39;
keywords:
author: 淡漠DM
language: zh-CN
timezone: &#39;&#39;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>启动项目</p>
<pre class="line-numbers language-none"><code class="language-none">hexo s<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p><img src="/img/note/image-20210128101052112.png" alt="image-20210128101052112" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128101052112.png" class="lozad post-image"></p>
<p>常用命令介绍</p>
<table>
<thead>
<tr>
<th>命令</th>
<th>简写</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>hexo server</td>
<td>hexo s</td>
<td>本地启动</td>
</tr>
<tr>
<td>hexo generate</td>
<td>hexo g</td>
<td>生成静态文件</td>
</tr>
<tr>
<td>hexo deploy</td>
<td>hexo d</td>
<td>部署网站</td>
</tr>
<tr>
<td>hexo clean</td>
<td>无</td>
<td>清除缓存及生成的静态文件</td>
</tr>
</tbody></table>
<h2 id="二、修改主题"><a href="#二、修改主题" class="headerlink" title="二、修改主题"></a>二、修改主题</h2><p>选择自己喜欢的主题</p>
<p><a target="_blank" rel="noopener" href="https://hexo.io/themes/">https://hexo.io/themes/</a></p>
<p><img src="/img/note/image-20210128101615969.png" alt="image-20210128101615969" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128101615969.png" class="lozad post-image"></p>
<p>这里选择Kaze</p>
<p><img src="/img/note/image-20210128101721783.png" alt="image-20210128101721783" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128101721783.png" class="lozad post-image"></p>
<p>进入themes文件夹，下载主题，并重命名为kaze</p>
<pre class="line-numbers language-none"><code class="language-none">cd themes<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<pre class="line-numbers language-none"><code class="language-none">git clone https:&#x2F;&#x2F;github.com&#x2F;theme-kaze&#x2F;hexo-theme-Kaze.git kaze<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>修改配置文件（_config.yml）</p>
<pre class="line-numbers language-none"><code class="language-none">theme: kaze<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>主题名称为文件夹名称，默认为：landscape</p>
<p>回到项目根目录，启动项目</p>
<pre class="line-numbers language-none"><code class="language-none">hexo clean
hexo g
hexo s<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p><img src="/img/note/image-20210128102140650.png" alt="image-20210128102140650" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128102140650.png" class="lozad post-image"></p>
<h2 id="三、完善博客项目"><a href="#三、完善博客项目" class="headerlink" title="三、完善博客项目"></a>三、完善博客项目</h2><h3 id="修改基本信息"><a href="#修改基本信息" class="headerlink" title="修改基本信息"></a>修改基本信息</h3><p>进入<code>themes/kaze/source</code> ，创建文件夹 <code>img</code>，放入logo图片和作者头像</p>
<pre class="line-numbers language-none"><code class="language-none">title: 淡漠Blog
author: 淡漠DM
logo_img: &#x2F;img&#x2F;logo.png # put the logo on the $&#123;blog_path&#125;&#x2F;source&#x2F;img&#x2F;$&#123;picname&#125;.png or use urls
author_img: &#x2F;img&#x2F;author.jpg
author_description: 最有趣的编程，莫过于服务生活。<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>


<p><img src="/img/note/image-20210128104118241.png" alt="image-20210128104118241" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128104118241.png" class="lozad post-image"></p>
<h3 id="开启站点访问量统计（默认关闭）"><a href="#开启站点访问量统计（默认关闭）" class="headerlink" title="开启站点访问量统计（默认关闭）"></a>开启站点访问量统计（默认关闭）</h3><pre class="line-numbers language-none"><code class="language-none">footer:
  statistics:
    enable: true
    type: busuanzi # now version only supports busuanzi
    pv:
      enable: true
      style: 本站总访问量&#123;&#125;次 # the style will be shown as $1&#123;pv&#125;$2
    uv:
      enable: true
      style: 本站总访客数&#123;&#125;次<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><code>enable</code> 开启访问量统计（默认关闭）</p>
<p><code>type</code> 目前仅支持 <code>busuanzi</code></p>
<p><code>pv</code> 访问总量统计</p>
<p><code>uv</code> 用户总量统计</p>
<p><img src="/img/note/image-20210128104201239.png" alt="image-20210128104201239" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128104201239.png" class="lozad post-image"></p>
<h3 id="友链"><a href="#友链" class="headerlink" title="友链"></a>友链</h3><pre class="line-numbers language-none"><code class="language-none">links:
  小R资源:
    url: https:&#x2F;&#x2F;www.tomyres.com
    avatar: https:&#x2F;&#x2F;www.tomyres.com&#x2F;static&#x2F;images&#x2F;logo&#x2F;res_logo_1.png
    description: 小R资源,免费的编程资源在线分享<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><img src="/img/note/image-20210128104211869.png" alt="image-20210128104211869" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128104211869.png" class="lozad post-image"></p>
<h3 id="文章头部"><a href="#文章头部" class="headerlink" title="文章头部"></a>文章头部</h3><p>hello-world.md</p>
<pre class="line-numbers language-none"><code class="language-none">---
title: Hello World
banner_img: https:&#x2F;&#x2F;www.tomyres.com&#x2F;static&#x2F;images&#x2F;logo&#x2F;res_logo_1.png
category: Hi
tag: hello
excerpt: 这是一段简介
---<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><code>banner_img</code> 文章封面</p>
<p><code>category</code> 分类</p>
<p><code>tag</code> 标签</p>
<p><code>excerpt</code> 简介</p>
<p><img src="/img/note/image-20210128104638299.png" alt="image-20210128104638299" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128104638299.png" class="lozad post-image"></p>
<h3 id="代码高亮"><a href="#代码高亮" class="headerlink" title="代码高亮"></a>代码高亮</h3><p>在md文件写一段JavaScript代码</p>
<pre class="line-numbers language-none"><code class="language-none">​&#96;&#96;&#96;javascript
const smoothScrollToTop &#x3D; () &#x3D;&gt; &#123;
  let yTopValve &#x3D; (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
  if (yTopValve &gt; 1) &#123;
    window.requestAnimationFrame(smoothScrollToTop);
    scrollTo(0, Math.floor(yTopValve * 0.85));
  &#125; else &#123;
    scrollTo(0, 0);
  &#125;
&#125;;

setTimeout(() &#x3D;&gt; &#123;
  document.getElementById(&#39;scrollbutton&#39;).onclick &#x3D; smoothScrollToTop;
&#125;, 0);
​&#96;&#96;&#96;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>关闭 highlight，开启 prismjs（_config.yml）</p>
<pre class="line-numbers language-none"><code class="language-none">highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: &#39;&#39;
  wrap: true
  hljs: false
prismjs:
  enable: true
  preprocess: true
  line_number: true
  tab_replace: &#39;&#39;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>设置主题（kaze/_config.yml）</p>
<pre class="line-numbers language-none"><code class="language-none">prism:
  theme: tomorrow<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<p><img src="/img/note/image-20210128202524441.png" alt="image-20210128202524441" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128202524441.png" class="lozad post-image"></p>
<h3 id="评论"><a href="#评论" class="headerlink" title="评论"></a>评论</h3><p>这里使用 valine 实现评论，官方网 <a target="_blank" rel="noopener" href="https://leancloud.cn/">https://leancloud.cn/</a></p>
<p>进入控制台后点击左下角创建应用</p>
<p><img src="/img/note/image-20210128234031212.png" alt="image-20210128234031212" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128234031212.png" class="lozad post-image"></p>
<p>应用创建好以后，进入刚刚创建的应用，选择左下角的设置&gt;应用Key，然后就能看到你的APP ID和APP Key了</p>
<p><img src="/img/note/image-20210128234050299.png" alt="image-20210128234050299" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128234050299.png" class="lozad post-image"></p>
<p>开启评论功能 <code>kaze/_config.yml</code></p>
<pre class="line-numbers language-none"><code class="language-none">comment:
  enable: true
  type: valine # valine | gitalk | livere | disqus | we recommend valine
  # gitalk config details can see in https:&#x2F;&#x2F;github.com&#x2F;gitalk&#x2F;gitalk&#x2F;blob&#x2F;master&#x2F;readme-cn.md
  valine:
    appId: 你的appId
    appKey: 你的appKey<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><img src="/img/note/image-20210128233709502.png" alt="image-20210128233709502" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128233709502.png" class="lozad post-image"></p>
<h2 id="四、部署gitee"><a href="#四、部署gitee" class="headerlink" title="四、部署gitee"></a>四、部署gitee</h2><p>创建一个公开的仓库，仓库名称需要和个人空间地址相同</p>
<p>个人空间地址查看方式：设置——&gt;基本设置——&gt;个人资料</p>
<p><img src="/img/note/image-20210128123114191.png" alt="image-20210128123114191" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128123114191.png" class="lozad post-image"></p>
<p>初始化</p>
<pre class="line-numbers language-none"><code class="language-none">git init
git remote add origin git@gitee.com:个人空间地址&#x2F;仓库名称.git
git pull origin master<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p>提交项目</p>
<pre class="line-numbers language-none"><code class="language-none">git add .
git commit -m &#39;我的第一个博客项目&#39;
git push origin master<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p>第一次提交时，确保仓库没有文件，因为如果仓库有文件，且文件名字正好和本地项目的某个文件名相同，会导致提交失败</p>
<p>修改配置文件</p>
<pre class="line-numbers language-none"><code class="language-none">deploy:
  type: git
  repo: git@gitee.com:个人空间地址&#x2F;仓库名称.git
  branch: master<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<p>部署到gitee</p>
<pre class="line-numbers language-none"><code class="language-none">npm install --save hexo-deployer-git<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<pre class="line-numbers language-none"><code class="language-none">hexo clean
hexo g
hexo d<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p><img src="/img/note/image-20210128191528868.png" alt="image-20210128191528868" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128191528868.png" class="lozad post-image"></p>
<p>选择强制使用https</p>
<p><img src="/img/note/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20210128111435.png" alt="微信截图_20210128111435" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20210128111435.png" class="lozad post-image"></p>
<p>部署后会显示网站地址，直接访问即可。</p>
<p>项目每一次更新提交到gitee之后，需要更新部署</p>
<p><img src="/img/note/image-20210128191646255.png" alt="image-20210128191646255" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="/img/note/image-20210128191646255.png" class="lozad post-image"></p>
<h3 id="注意"><a href="#注意" class="headerlink" title="注意"></a>注意</h3><p>如果更新部署后访问项目没有变化，可以尝试 <code>CTRL+F5</code> 强制刷新，或清除浏览器缓存。</p>

  </div>
  <div>
  
  <div class="post-note note-warning copyright" style="margin-top: 42px">
    <p><span style="font-weight: bold;">作者：</span><a target="_blank" rel="nofollow noopener noreferrer" href="http://blog.tomyres.com/about">淡漠DM</a></p>
    <p><span style="font-weight: bold;">文章链接：</span><a target="_blank" rel="nofollow noopener noreferrer" href="http://blog.tomyres.com/2021/01/29/blog-1/">http://blog.tomyres.com/2021/01/29/blog-1/</a></p>
    <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
  </div>
  
  </div>
</article>
<div class="nav">
  
  <div class="nav-item-prev">
    <a href="/2021/01/29/blog-2/" class="nav-link">
      <i class="iconfont icon-left nav-prev-icon"></i>
      <div>
        <div class="nav-label">上一篇</div>
        
        <div class="nav-title">小技巧，方便写个人博客MD文档 </div>
        
      </div>
    </a>
  </div>
  
  
  <div class="nav-item-next">
    <a href="/2021/01/29/domain-1/" class="nav-link">
      <div>
        <div class="nav-label">下一篇</div>
        
        <div class="nav-title">域名注册及证书申请 </div>
        
      </div>
      <i class="iconfont icon-right nav-next-icon"></i>
    </a>
  </div>
  
</div>

<div class="card card-content comment-card" style="margin-top: 16px;">
  <div class="comment-card-title">评论</div>
  
  <div id="vcomments"></div>
  
  <script>
    loadScript("//unpkg.com/valine/dist/Valine.min.js");
    var oldLoadVa = window.onload;
    window.onload = function () {
      oldLoadVa && oldLoadVa();
      new Valine({
        el: '#vcomments',
        appId: 'yCtTrCmh5gIiOdpVsrQFQ7mV-gzGzoHsz',
        appKey: 'Gj2RnArTDCt9UCInhJkEIubB',
        placeholder: 'Just go go',
        path: window.location.pathname,
        avatar: 'mp',
        meta: ["nick","mail","link"],
        pageSize: '10',
        lang: '',
        visitor: 'false',
        highlight: true,
        recordIP: false,
        
        
        
        enableQQ: 'false',
        requiredFields: [],
      });
    };
  </script>

</div>

<div class="card card-content toc-card" id="mobiletoc">
  <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%88%9B%E5%BB%BA%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE"><span class="toc-text">一、创建博客项目</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E4%BF%AE%E6%94%B9%E4%B8%BB%E9%A2%98"><span class="toc-text">二、修改主题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E5%AE%8C%E5%96%84%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE"><span class="toc-text">三、完善博客项目</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="toc-text">修改基本信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%80%E5%90%AF%E7%AB%99%E7%82%B9%E8%AE%BF%E9%97%AE%E9%87%8F%E7%BB%9F%E8%AE%A1%EF%BC%88%E9%BB%98%E8%AE%A4%E5%85%B3%E9%97%AD%EF%BC%89"><span class="toc-text">开启站点访问量统计（默认关闭）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%8B%E9%93%BE"><span class="toc-text">友链</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%A4%B4%E9%83%A8"><span class="toc-text">文章头部</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE"><span class="toc-text">代码高亮</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA"><span class="toc-text">评论</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%9B%E3%80%81%E9%83%A8%E7%BD%B2gitee"><span class="toc-text">四、部署gitee</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B3%A8%E6%84%8F"><span class="toc-text">注意</span></a></li></ol></li></ol>
</div></main>
          <aside class="left-column">
            
            <div class="card card-author">
              
<img src="/img/author.jpg" class="author-img">

<p class="author-name">淡漠DM</p>
<p class="author-description">最有趣的编程，莫过于服务生活。</p>
<div class="author-message">
  <a class="author-posts-count" href="/archives">
    <span>4</span>
    <span>文章</span>
  </a>
  <a class="author-categories-count" href="/categories">
    <span>2</span>
    <span>分类</span>
  </a>
  <a class="author-tags-count" href="/tags">
    <span>7</span>
    <span>标签</span>
  </a>
</div>

            </div>
            
            <div class="sticky-tablet">
  
  
  <article class="display-when-two-columns spacer">
    <div class="card card-content toc-card">
      <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%88%9B%E5%BB%BA%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE"><span class="toc-text">一、创建博客项目</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E4%BF%AE%E6%94%B9%E4%B8%BB%E9%A2%98"><span class="toc-text">二、修改主题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E5%AE%8C%E5%96%84%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE"><span class="toc-text">三、完善博客项目</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="toc-text">修改基本信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%80%E5%90%AF%E7%AB%99%E7%82%B9%E8%AE%BF%E9%97%AE%E9%87%8F%E7%BB%9F%E8%AE%A1%EF%BC%88%E9%BB%98%E8%AE%A4%E5%85%B3%E9%97%AD%EF%BC%89"><span class="toc-text">开启站点访问量统计（默认关闭）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%8B%E9%93%BE"><span class="toc-text">友链</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%A4%B4%E9%83%A8"><span class="toc-text">文章头部</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE"><span class="toc-text">代码高亮</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA"><span class="toc-text">评论</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%9B%E3%80%81%E9%83%A8%E7%BD%B2gitee"><span class="toc-text">四、部署gitee</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B3%A8%E6%84%8F"><span class="toc-text">注意</span></a></li></ol></li></ol>
    </div>
  </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header"><i class="iconfont icon-fenlei" style="padding-right: 2px;"></i>分类</div>
  <div class="categories-list">
    
      <a href="/categories/个人博客">
        <div class="categories-list-item">
          个人博客
          <span class="categories-list-item-badge">3</span>
        </div>
      </a>
    
      <a href="/categories/域名">
        <div class="categories-list-item">
          域名
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header"><i class="iconfont icon-biaoqian" style="padding-right: 2px;"></i>热门标签</div>
  <div class="tags-list">
    
    <a href="\tags\搭建个人博客" title="搭建个人博客"><div class="tags-list-item">搭建个人博客</div></a>
    
    <a href="\tags\Hexo搭建博客" title="Hexo搭建博客"><div class="tags-list-item">Hexo搭建博客</div></a>
    
    <a href="\tags\博客小技巧" title="博客小技巧"><div class="tags-list-item">博客小技巧</div></a>
    
    <a href="\tags\域名注册" title="域名注册"><div class="tags-list-item">域名注册</div></a>
    
    <a href="\tags\证书申请" title="证书申请"><div class="tags-list-item">证书申请</div></a>
    
    <a href="\tags\七牛云" title="七牛云"><div class="tags-list-item">七牛云</div></a>
    
    <a href="\tags\自定义域名" title="自定义域名"><div class="tags-list-item">自定义域名</div></a>
    
  </div>
</div>
  </article>
  
  
</div>
          </aside>
          <aside class="right-column">
            <div class="sticky-widescreen">
  
  
  <article class="card card-content toc-card">
    <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%88%9B%E5%BB%BA%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE"><span class="toc-text">一、创建博客项目</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E4%BF%AE%E6%94%B9%E4%B8%BB%E9%A2%98"><span class="toc-text">二、修改主题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E5%AE%8C%E5%96%84%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE"><span class="toc-text">三、完善博客项目</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="toc-text">修改基本信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%80%E5%90%AF%E7%AB%99%E7%82%B9%E8%AE%BF%E9%97%AE%E9%87%8F%E7%BB%9F%E8%AE%A1%EF%BC%88%E9%BB%98%E8%AE%A4%E5%85%B3%E9%97%AD%EF%BC%89"><span class="toc-text">开启站点访问量统计（默认关闭）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%8B%E9%93%BE"><span class="toc-text">友链</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%A4%B4%E9%83%A8"><span class="toc-text">文章头部</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE"><span class="toc-text">代码高亮</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA"><span class="toc-text">评论</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%9B%E3%80%81%E9%83%A8%E7%BD%B2gitee"><span class="toc-text">四、部署gitee</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B3%A8%E6%84%8F"><span class="toc-text">注意</span></a></li></ol></li></ol>
  </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header"><i class="iconfont icon-wenzhang_huaban" style="padding-right: 2px;"></i>最近文章</div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-01-30</div>
        <a href="/2021/01/30/blog-3/"><div class="recent-posts-item-content">个人博客部署七牛云，并且使用自定义域名</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-01-29</div>
        <a href="/2021/01/29/blog-2/"><div class="recent-posts-item-content">小技巧，方便写个人博客MD文档</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-01-29</div>
        <a href="/2021/01/29/blog-1/"><div class="recent-posts-item-content">手把手教你搭建、上线个人博客</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-01-29</div>
        <a href="/2021/01/29/domain-1/"><div class="recent-posts-item-content">域名注册及证书申请</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
          </aside>
        </div>
      </div>
    </div>
  </div>
  
  <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>Copyright ©
          
          2020 -
          
          2021
        </span>
        &nbsp;
        <a href="/" class="footer-link">淡漠-Blog </a>
      </div>
    </div>

    
    <div class="footer-dsc">
      
      Powered by
      <a href="https://hexo.io/" class="footer-link" target="_blank" rel="nofollow noopener noreferrer">&nbsp;Hexo </a>
      
      
      <span>&nbsp;|&nbsp;</span>
      
      
      Theme -
      <a href="https://github.com/theme-kaze" class="footer-link" target="_blank"
        rel="nofollow noopener noreferrer">&nbsp;Kaze</a>
      
    </div>
    
    
    
    
      <div class="footer-dsc">
        
        本站总访问量<span id="busuanzi_value_site_pv"></span>次
        
        
        <span>&nbsp;|&nbsp;</span>
        
        
        本站总访客数<span id="busuanzi_value_site_uv"></span>次
        
      </div>
      
    
</footer>
  <a role="button" id="scrollbutton" class="basebutton"  aria-label="回到顶部">
  <i class="iconfont icon-arrowleft button-icon"></i>
</a>
<a role="button" id="menubutton" class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a role="button" id="popbutton" class="basebutton" aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a role="button" id="darkbutton" class="basebutton darkwidget" aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a role="button" id="searchbutton" class="basebutton searchwidget" aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a>

  
  
  
  <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img');
    var i;
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a');
      wrapper.setAttribute('href', img[i].getAttribute('data-src'));
      wrapper.setAttribute('aria-label', 'illustration');
      wrapper.style.cssText = 'width: 100%; display: flex; justify-content: center;';
      if (img[i].alt) wrapper.dataset.caption = img[i].alt;
      wrapper.dataset.nolink = true;
      img[i].before(wrapper);
      wrapper.append(img[i]);
      var divWrap = document.createElement('div');
      divWrap.classList.add('gallery');
      wrapper.before(divWrap);
      divWrap.append(wrapper);
    }
    baguetteBox.run('.gallery');
  }
</script>
<script>loadScript("/js/lib/lightbox/baguetteBox.min.js", addImgLayout)</script>
  
  
  
<script src="/js/main.js"></script>

  
  <script>loadScript("/js/lib/busuanzi.min.js")</script>
  
  
  <script>
    var addLazyload = function () {
      var observer = lozad('.lozad', {
        load: function (el) {
          el.srcset = el.getAttribute('data-src');
        },
        loaded: function (el) {
          el.classList.add('loaded');
        }
      });
      observer.observe();
    }
  </script>
  <script>loadScript("/js/lib/lozad.min.js", addLazyload)</script>
  
  
</body>

</html>